package com.vn.ld.order.facade;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.vn.ld.api.order.dto.OrderDTO;
import com.vn.ld.api.order.service.RSOrderService;
import com.vn.ld.api.utils.ObjectConverter;
import com.vn.ld.btc.dao.entity.Order;
import com.vn.ld.order.service.IOrderService;

@Component
public class OrderServiceFacade implements RSOrderService {
	
	@Autowired
	private ObjectConverter converter;
	@Autowired
	private IOrderService orderService;
	
	@Override
	public Boolean placeOrder(OrderDTO orderDto) {
		Order order = new Order();
		order = (Order) this.converter.convert(orderDto, new Order());
		return this.orderService.placeOrder(order);
	}

}
